﻿using AutoMapper.Configuration.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Data;
using Volo.Abp.Domain;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
using XDQ.VAT.Classes;

namespace XDQ.VAT.Exams
{
    public class AppExam : CreationAuditedEntity<Guid>, ISoftDelete, IMultiTenant, IHasExtraProperties
    {
        [MaxLength(200)]
        public virtual string Name { get; protected set; }

        [Required]
        public virtual DateTime? ExamOnDate { get; protected set; }
                
        [Required]
        public virtual Guid? CourseId { get; protected set; }

        [Required]
        public virtual Guid? ClassId { get; protected set; }

        [Ignore]
        public virtual Guid? TenantId { get; protected set; }

        [Required]
        [Ignore]
        public bool? IsDeleted { get; protected set; }

        [Ignore]
        bool ISoftDelete.IsDeleted { get => IsDeleted ?? false; set => IsDeleted = value; }


        public virtual Volo.Abp.Data.ExtraPropertyDictionary ExtraProperties { get; protected set; }

        protected AppExam() { }

        public AppExam(string name, DateTime? examOnDate, Guid? courseId, Guid? classId)
        {
            Name = name;
            ExamOnDate = examOnDate;
            CourseId = courseId;
            ClassId = classId;
        }
    }
}
